import _ from 'lodash';

import './style.css';

import duckImg from './assets/image/duck.jpg'

import data from './data.json';

import printMe from './js/print.js';

function component() {
    const element = document.createElement('div');

    // 执行这一行需要引入 lodash（目前通过 script 脚本引入）
    element.innerHTML = _.join(['Hello', 'webpack'], ' ');
    element.classList.add('hello');

    const myIcon = new Image();
    myIcon.src = duckImg;
  
    element.appendChild(myIcon);
    
    console.log("data", data);

    const btn = document.createElement('button');

    btn.innerHTML = 'Click me and check the console!';
    btn.onclick = printMe;
  
    element.appendChild(btn);
    
    return element;
}


document.body.appendChild(component());

a = 1/0;
a++;